home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Mise à jour / Speech Recognition 1.5a1 / SR 1.5a1 Interfaces & Lib / SpeechRecognition.a next >
Text File  |  1995-12-08  |  25KB  |  777 lines

  1. ;
  2. ;    File:        SpeechRecognition.a
  3. ;
  4. ;    Contains:    Apple Speech Recognition Toolbox Interfaces.
  5. ;
  6. ;    Version:    Technology:    PlainTalk 1.5
  7. ;
  8. ;                Release:    PlainTalk Developer Release
  9. ;
  10. ;    Copyright:    ⌐ 1984-1995 by Apple Computer, Inc.
  11. ;
  12. ;                All rights reserved.
  13. ;
  14. ;    Bugs?:        If you find a problem with this file, send the file and version
  15. ;                information (from above) and the problem description to:
  16. ;
  17. ;                    Internet:    apple.bugs@applelink.apple.com
  18. ;                    AppleLink:    APPLE.BUGS
  19. ;
  20. ;
  21.     IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
  22. __SPEECHRECOGNITION__ SET 1
  23.  
  24.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  25.     include 'Memory.a'
  26.     ENDIF
  27.  
  28. gestaltSpeechRecognitionVersion    EQU        'srtb'
  29. gestaltSpeechRecognitionAttr    EQU        'srta'
  30.  
  31. gestaltDesktopSpeechRecognition    EQU        $01
  32. gestaltTelephoneSpeechRecognition EQU    $02
  33. ;  Error Codes [Speech recognition gets -5100 through -5199] 
  34.  
  35. eSRNotAvailable                    EQU        -5100                ; the service requested is not avail or applicable 
  36. eSRInternalError                EQU        -5101                ; a system internal or hardware error condition 
  37. eSRComponentNotFound            EQU        -5102                ; a needed system resource was not located 
  38. eSROutOfMemory                    EQU        -5103                ; an out of memory error occurred in the toolbox memory space 
  39. eSRNotASpeechObject                EQU        -5104                ; the object specified is no longer or never was valid 
  40. eSRBadParameter                    EQU        -5105                ; an invalid parameter was specified 
  41. eSRParamOutOfRange                EQU        -5106                ; when we say 0-100, don't pass in 101. 
  42. eSRBadSelector                    EQU        -5107                ; an unrecognized selector was specified 
  43. eSRBufferTooSmall                EQU        -5108                ; returned from attribute access functions 
  44. eSRNotARecSystem                EQU        -5109                ; the object used was not a RecognitionSystem 
  45. eSRFeedbackNotAvail                EQU        -5110                ; there is no feedback window associated with Recognizer 
  46. eSRCantSetProperty                EQU        -5111                ; a non-settable property was specified 
  47. eSRCantGetProperty                EQU        -5112                ; a non-gettable property was specified 
  48. eSRCantSetDuringRecognition        EQU        -5113                ; the property can't be set while recognition is in progress -- do before or between utterances. 
  49. eSRAlreadyListening                EQU        -5114                ; in response to SRStartListening 
  50. eSRNotListeningState            EQU        -5115                ; in response to SRStopListening 
  51. eSRModelMismatch                EQU        -5116                ; no acoustical models are avail to match request 
  52. eSRNoClientLanguageModel        EQU        -5117                ; trying to access a non-specified LanguageModel 
  53. eSRNoPendingUtterances            EQU        -5118                ; nothing to continue search on 
  54. eSRRecognitionCanceled            EQU        -5119                ; an abort error occurred during search 
  55. eSRRecognitionDone                EQU        -5120                ; search has finished, but nothing was recognized 
  56. eSROtherRecAlreadyModal            EQU        -5121                ; another recognizer is modal at the moment, so can't set this recognizer's kBlockModally property right now 
  57. eSRHasNoSubItems                EQU        -5122                ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. 
  58. eSRSubItemNotFound                EQU        -5123                ; returned when accessing a non-existent sub item of a container 
  59. eSRLanguageModelTooBig            EQU        -5124                ; Cant build language models so big 
  60. eSRAlreadyReleased                EQU        -5125                ; this object has already been released before 
  61. eSRAlreadyFinished                EQU        -5126                ; the language model can't be finished twice 
  62. eSRWordNotFound                    EQU        -5127                ; the spelling couldn't be found in lookup(s) 
  63. eSRNotFinishedWithRejection        EQU        -5128                ; property not found because the LMObj is not finished with rejection 
  64. eSRExpansionTooDeep                EQU        -5129                ; Language model is left recursive or is embedded too many levels 
  65. eSRTooManyElements                EQU        -5130                ; Too many elements added to phrase or path or other langauge model object 
  66. eSRCantAdd                        EQU        -5131                ; Can't add given type of object to the base LanguageObject (e.g.in SRAddLanguageObject)    
  67. eSRSndInSourceDisconnected        EQU        -5132                ; Sound input source is disconnected 
  68. eSRCantReadLanguageObject        EQU        -5133                ; An error while trying to create new Language object from file or pointer -- possibly bad format 
  69.                                                             ; non-release debugging error codes are included here 
  70. eSRNotImplementedYet            EQU        -5199                ; you'd better wait for this feature in a future release 
  71. ;  Type Definitions 
  72. ; typedef unsigned long                 SpeechObject
  73.  
  74. ; typedef SpeechObject                     RecognitionSystem
  75.  
  76. ; typedef SpeechObject                     Recognizer
  77.  
  78. ; typedef SpeechObject                     SpeechSource
  79.  
  80. ; typedef SpeechSource                     RecognitionResult
  81.  
  82. ; typedef SpeechObject                     LanguageObject
  83.  
  84. ; typedef LanguageObject                 LanguageModel
  85.  
  86. ; typedef LanguageObject                 LMPath
  87.  
  88. ; typedef LanguageObject                 LMPhrase
  89.  
  90. ; typedef LanguageObject                 LMWord
  91.  
  92. ; typedef unsigned long                 LMFlags
  93.  
  94. ;  between 0 and 100 
  95. ; typedef unsigned short                 SpeedSetting
  96.  
  97. ;  between 0 and 100 
  98. ; typedef unsigned short                 RejectionLevel
  99.  
  100. ;  When an event occurs, the user supplied proc will be called with a pointer    
  101. ;     to the param passed in and a flag to indicate conditions such                
  102. ;     as interrupt time or system background time.                                
  103. SRCallBackStruct        RECORD 0
  104. what                     ds.l    1                ; offset: $0 (0)        ;  one of notification flags 
  105. message                     ds.l    1                ; offset: $4 (4)        ;  contains RecognitionResult id 
  106. instance                 ds.l    1                ; offset: $8 (8)        ;  ID of recognizer being notified 
  107. status                     ds.w    1                ; offset: $C (12)        ;  result status of last search 
  108. flags                     ds.w    1                ; offset: $E (14)        ;  non-zero if occurs during interrupt 
  109. refCon                     ds.l    1                ; offset: $10 (16)        ;  user defined - set from SRCallBackParam 
  110. sizeof                     EQU *                    ; size:   $14 (20)
  111.                         ENDR
  112. ;  Call back procedure definition 
  113. SRCallBackParam            RECORD 0
  114. callBack                 ds.l    1                ; offset: $0 (0)
  115. refCon                     ds.l    1                ; offset: $4 (4)
  116. sizeof                     EQU *                    ; size:   $8 (8)
  117.                         ENDR
  118. ;  Recognition System Types 
  119.  
  120. kDefaultRecognitionSystemID        EQU        0
  121. ;  Recognition System Properties 
  122.  
  123. kRejectedWord                    EQU        'rejq'                ; the LMWord used to represent a rejection 
  124. kSeparationChars                EQU        'spch'                ; separation chars for current dialect setting -- use pointer to SeparationChars struct, defined in Dialect.h 
  125. kFeedbackAndListeningModes        EQU        'fbwn'                ; short: one of kNoFeedbackHasListenModes, kHasFeedbackHasListenModes, kNoFeedbackNoListenModes 
  126.  
  127. kNoFeedbackNoListenModes        EQU        0                    ; next allocated recognizer has no feedback window and doesn't use listening modes    
  128. kHasFeedbackHasListenModes        EQU        1                    ; next allocated recognizer has feedback window and uses listening modes             
  129. kNoFeedbackHasListenModes        EQU        2                    ; next allocated recognizer has no feedback window but does use listening modes     
  130. ;  Speech Source Types 
  131.  
  132. kSRDefaultSpeechSource            EQU        0
  133. kLiveDesktopSpeechSource        EQU        'dklv'                ; live desktop sound input 
  134. kCannedDesktopSpeechSource        EQU        'ca22'                ; AIFF file based 16 bit, 22.050 KHz sound input 
  135. ;  Notification via Apple Event or Callback 
  136. ;  Notification Flags 
  137.  
  138. kNotifyRecognitionBeginning        EQU        $01                    ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition 
  139. kNotifyRecognitionDone            EQU        $02                    ; recognition has terminated. result (if any) is available. 
  140. ;  Apple Event selectors 
  141. ;  AppleEvent message class  
  142.  
  143. kAESpeechSuite                    EQU        'sprc'
  144. ;  AppleEvent message event ids 
  145.  
  146. kAESpeechDone                    EQU        'srsd'
  147. kAESpeechDetected                EQU        'srbd'
  148. ;  AppleEvent Parameter ids 
  149.  
  150. keyRecognizer                    EQU        'krec'
  151. keySpeechResult                    EQU        'kspr'
  152. keySpeechStatus                    EQU        'ksst'
  153. ;  AppleEvent Parameter types 
  154.  
  155. typeRecognizer                    EQU        'trec'
  156. typeSpeechResult                EQU        'tspr'
  157. ;  Recognizer Properties 
  158.  
  159. kSearchStatusParam                EQU        'stat'                ; see status flags below 
  160. kNotificationParam                EQU        'noti'                ; see notification flags below 
  161. kCallBackParam                    EQU        'call'                ; type SRCallBackParam 
  162. kAutoFinishingParam                EQU        'afin'                ; automatic finishing applied on LM for search 
  163. kForegroundOnly                    EQU        'fgon'                ; Boolean. Default is true. If true, client recognizer only active when in foreground.    
  164. kBlockBackground                EQU        'blbg'                ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    
  165. kBlockModally                    EQU        'blmd'                ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! 
  166. kWantsResultTextDrawn            EQU        'txfb'                ; Boolean. Default is true. If true, search results are posted to Feedback window 
  167. kWantsAutoFBGestures            EQU        'dfbr'                ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior 
  168. kSoundInVolume                    EQU        'volu'                ; short in [0..100] log scaled sound input power. Can't set this property 
  169. kReadAudioFSSpec                EQU        'aurd'                ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kCannedDesktopSpeechSource. Reads until EOF 
  170. kCancelOnSoundOut                EQU        'caso'                ; Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. 
  171. kSpeedVsAccuracyParam            EQU        'sped'                ; SpeedSetting between 0 and 100 
  172. ;  0 means more accurate but slower. 
  173. ;  100 means (much) less accurate but faster. 
  174.  
  175. kUseToggleListen                EQU        0                    ; listen key modes 
  176. kUsePushToTalk                    EQU        1
  177.  
  178. kListenKeyMode                    EQU        'lkmd'                ; short: either kUseToggleListen or kUsePushToTalk 
  179. kListenKeyCombo                    EQU        'lkey'                ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message 
  180. kListenKeyName                    EQU        'lnam'                ; Str63: string representing ListenKeyCombo 
  181. kKeyWord                        EQU        'kwrd'                ; Str255: keyword preceding spoken commands in kUseToggleListen mode 
  182. kKeyExpected                    EQU        'kexp'                ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? 
  183. ;  Operational Status Flags 
  184.  
  185. kIdleRecognizer                    EQU        $01                    ; engine is not active 
  186. kSearchInProgress                EQU        $02                    ; search is in progress 
  187. kSearchWaitForAllClients        EQU        $04                    ; search is suspended waiting on all clients' input 
  188. kMustCancelSearch                EQU        $08                    ; something has occurred (sound played, non-speech detected) requiring the search to abort 
  189. kPendingSearch                    EQU        $10                    ; we're about to start searching 
  190. ;  Recognition Result Properties 
  191.  
  192. kTEXTFormat                        EQU        'TEXT'                ; raw text in user supplied memory 
  193. kLMPhraseFormat                    EQU        'lmph'                ; LMPhrase containing result words 
  194. kLMPathFormat                    EQU        'lmpt'                ; LMPath containing result phrases or words 
  195. kLanguageModelFormat            EQU        'lmfm'                ; top level LanguageModel for post parse 
  196. ;  LanguageObject Family Properties 
  197.  
  198. kSpelling                        EQU        'spel'                ; spelling of a LMWord or LMPhrase or LMPath, or name of a LanguageModel 
  199. kLMObjType                        EQU        'lmtp'                ; Returns one of LanguageObject Types listed below 
  200. kRefCon                            EQU        'refc'                ; 4 bytes of user storage 
  201. kEnabled                        EQU        'enbl'                ; Boolean -- true if LanguageObject enabled 
  202. kOptional                        EQU        'optl'                ; Boolean -- true if LanguageObject is optional    
  203. kRepeatable                        EQU        'rptb'                ; Boolean -- true if LanguageObject is repeatable 
  204. kRejectable                        EQU        'rjbl'                ; Boolean -- true if LanguageObject is rejectable (Recognition System's kRejectedWord 
  205.                                                             ;        object can be returned in place of LanguageObject with this property)    
  206. kPrimitive                        EQU        'prim'                ; Boolean -- determines what shows up in search result's list of primitives 
  207. kRejectionLevel                    EQU        'rjct'                ; RejectionLevel between 0 and 100 
  208. kFinishingFlags                    EQU        'finf'                ; Please use kOptional, kRepeatable, and kRejetable instead. pass pointer to LMFlags. Being phased out of public interfaces. 
  209. ;  LM Object Types -- returned as kLMObjType property of language model objects 
  210.  
  211. kLMType                            EQU        'lmob'                ; LanguageModel 
  212. kPathType                        EQU        'path'                ; LMPath 
  213. kPhraseType                        EQU        'phra'                ; LMPhrase 
  214. kWordType                        EQU        'word'                ; LMWord 
  215. ;  a normal and reasonable rejection level 
  216.  
  217. kDefaultLMRejectionLevel        EQU        50
  218. ;  Finishing Flags - used to make up LMFlags, which is used for kFinishingFlags and kAutoFinishingParam properties  
  219. ;  4/10/95 These finishing flags are being phased out of the public interfaces.  Please use kOptional, kRepeatable, 
  220. ;     and kRejectable Boolean LanguageObject properties instead.  Those Boolean properties are easier to use.            
  221.  
  222.                                                             ; bit zero is reserved 
  223. kAddPauses                        EQU        $02                    ; allows user to pause between words 
  224. kAddRejection                    EQU        $04                    ; unrecognized words will be rejected 
  225. kAddNoise                        EQU        $08                    ; allows a some noise at beginning or end of utterance 
  226. kMakeOptional                    EQU        $10                    ; contents of LM are optional 
  227. kMakeRepeatable                    EQU        $20                    ; contents of LM may be repeated 0 or more times 
  228.  
  229. kAddWordSpotting                EQU        $24
  230. kDefaultFinishing                EQU        $02
  231. kNoFinishing                    EQU        0
  232. ; ******************************************************************************
  233. ;                         NOTES ON USING THE API                                    
  234. ;                                                                                 
  235. ;         All operations (with the exception of SRGetRecognitionSystem) are        
  236. ;         directed toward an object allocated or begot from New, Get and Read        
  237. ;         type calls.                                                                
  238. ;                                                                                 
  239. ;         There is a simple rule in dealing with allocation and disposal:            
  240. ;                                                                                 
  241. ;         *    all toolbox allocations are obtained from a RecognitionSystem        
  242. ;                                                                                 
  243. ;         *    if you obtain an object via New or Get, then you own a reference     
  244. ;             to that object and it must be released via SRReleaseObject when        
  245. ;             you no longer need it                                                
  246. ;                                                                                 
  247. ;         *    when you receive a RecognitionResult object via AppleEvent or        
  248. ;             callback, it has essentially been created on your behalf and so        
  249. ;             you are responsible for releasing it as above                        
  250. ;                                                                                 
  251. ;         *    when you close a RecognitionSystem, all remaining objects which        
  252. ;             were allocated with it will be forcefully released and any            
  253. ;             remaining references to those objects will be invalid.                
  254. ;                                                                                 
  255. ;         This translates into a very simple guideline:                            
  256. ;             If you allocate it or have it allocated for you, you must release    
  257. ;             it.  If you are only peeking at it, then don't release it.            
  258. ;                                                                                 
  259. ; ******************************************************************************
  260. ;  Opening and Closing of the RecognitionSystem 
  261. ;
  262. ; pascal OSErr SROpenRecognitionSystem(RecognitionSystem *system, OSType systemID)
  263. ;
  264.     IF ┬ GENERATINGCFM THEN
  265.         Macro
  266.         _SROpenRecognitionSystem
  267.             move.w              #$0400,d0
  268.             dc.w                $AA56
  269.         EndM
  270.     ELSE
  271.         IMPORT_CFM_FUNCTION SROpenRecognitionSystem
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal OSErr SRCloseRecognitionSystem(RecognitionSystem system)
  276. ;
  277.     IF ┬ GENERATINGCFM THEN
  278.         Macro
  279.         _SRCloseRecognitionSystem
  280.             move.w              #$0201,d0
  281.             dc.w                $AA56
  282.         EndM
  283.     ELSE
  284.         IMPORT_CFM_FUNCTION SRCloseRecognitionSystem
  285.     ENDIF
  286.  
  287. ;  Accessing Properties of any Speech Object 
  288. ;
  289. ; pascal OSErr SRSetProperty(SpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  290. ;
  291.     IF ┬ GENERATINGCFM THEN
  292.         Macro
  293.         _SRSetProperty
  294.             move.w              #$0802,d0
  295.             dc.w                $AA56
  296.         EndM
  297.     ELSE
  298.         IMPORT_CFM_FUNCTION SRSetProperty
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal OSErr SRGetProperty(SpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  303. ;
  304.     IF ┬ GENERATINGCFM THEN
  305.         Macro
  306.         _SRGetProperty
  307.             move.w              #$0803,d0
  308.             dc.w                $AA56
  309.         EndM
  310.     ELSE
  311.         IMPORT_CFM_FUNCTION SRGetProperty
  312.     ENDIF
  313.  
  314. ;  Any object obtained via New or Get type calls must be released 
  315. ;
  316. ; pascal OSErr SRReleaseObject(SpeechObject srObject)
  317. ;
  318.     IF ┬ GENERATINGCFM THEN
  319.         Macro
  320.         _SRReleaseObject
  321.             move.w              #$0204,d0
  322.             dc.w                $AA56
  323.         EndM
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION SRReleaseObject
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal OSErr SRGetReference(SpeechObject srObject, SpeechObject *newObjectRef)
  330. ;
  331.     IF ┬ GENERATINGCFM THEN
  332.         Macro
  333.         _SRGetReference
  334.             move.w              #$0425,d0
  335.             dc.w                $AA56
  336.         EndM
  337.     ELSE
  338.         IMPORT_CFM_FUNCTION SRGetReference
  339.     ENDIF
  340.  
  341. ;  Traversing RecognitionResult or LMObjects 
  342. ;
  343. ; pascal OSErr SRCountItems(SpeechObject container, long *count)
  344. ;
  345.     IF ┬ GENERATINGCFM THEN
  346.         Macro
  347.         _SRCountItems
  348.             move.w              #$0405,d0
  349.             dc.w                $AA56
  350.         EndM
  351.     ELSE
  352.         IMPORT_CFM_FUNCTION SRCountItems
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal OSErr SRGetIndItem(SpeechObject container, SpeechObject *item, long index)
  357. ;
  358.     IF ┬ GENERATINGCFM THEN
  359.         Macro
  360.         _SRGetIndItem
  361.             move.w              #$0606,d0
  362.             dc.w                $AA56
  363.         EndM
  364.     ELSE
  365.         IMPORT_CFM_FUNCTION SRGetIndItem
  366.     ENDIF
  367.  
  368. ;
  369. ; pascal OSErr SRSetIndItem(SpeechObject container, SpeechObject item, long index)
  370. ;
  371.     IF ┬ GENERATINGCFM THEN
  372.         Macro
  373.         _SRSetIndItem
  374.             move.w              #$0607,d0
  375.             dc.w                $AA56
  376.         EndM
  377.     ELSE
  378.         IMPORT_CFM_FUNCTION SRSetIndItem
  379.     ENDIF
  380.  
  381. ;
  382. ; pascal OSErr SRRemoveIndItem(SpeechObject container, long index)
  383. ;
  384.     IF ┬ GENERATINGCFM THEN
  385.         Macro
  386.         _SRRemoveIndItem
  387.             move.w              #$0408,d0
  388.             dc.w                $AA56
  389.         EndM
  390.     ELSE
  391.         IMPORT_CFM_FUNCTION SRRemoveIndItem
  392.     ENDIF
  393.  
  394. ;  Recognizer Instance Functions 
  395. ;
  396. ; pascal OSErr SRNewRecognizer(RecognitionSystem system, Recognizer *instance, OSType sourceID)
  397. ;
  398.     IF ┬ GENERATINGCFM THEN
  399.         Macro
  400.         _SRNewRecognizer
  401.             move.w              #$060A,d0
  402.             dc.w                $AA56
  403.         EndM
  404.     ELSE
  405.         IMPORT_CFM_FUNCTION SRNewRecognizer
  406.     ENDIF
  407.  
  408. ;
  409. ; pascal OSErr SRStartListening(Recognizer instance)
  410. ;
  411.     IF ┬ GENERATINGCFM THEN
  412.         Macro
  413.         _SRStartListening
  414.             move.w              #$020C,d0
  415.             dc.w                $AA56
  416.         EndM
  417.     ELSE
  418.         IMPORT_CFM_FUNCTION SRStartListening
  419.     ENDIF
  420.  
  421. ;
  422. ; pascal OSErr SRStopListening(Recognizer instance)
  423. ;
  424.     IF ┬ GENERATINGCFM THEN
  425.         Macro
  426.         _SRStopListening
  427.             move.w              #$020D,d0
  428.             dc.w                $AA56
  429.         EndM
  430.     ELSE
  431.         IMPORT_CFM_FUNCTION SRStopListening
  432.     ENDIF
  433.  
  434. ;
  435. ; pascal OSErr SRSetLanguageModel(Recognizer instance, LanguageModel active)
  436. ;
  437.     IF ┬ GENERATINGCFM THEN
  438.         Macro
  439.         _SRSetLanguageModel
  440.             move.w              #$040E,d0
  441.             dc.w                $AA56
  442.         EndM
  443.     ELSE
  444.         IMPORT_CFM_FUNCTION SRSetLanguageModel
  445.     ENDIF
  446.  
  447. ;
  448. ; pascal OSErr SRGetLanguageModel(Recognizer instance, LanguageModel *active)
  449. ;
  450.     IF ┬ GENERATINGCFM THEN
  451.         Macro
  452.         _SRGetLanguageModel
  453.             move.w              #$040F,d0
  454.             dc.w                $AA56
  455.         EndM
  456.     ELSE
  457.         IMPORT_CFM_FUNCTION SRGetLanguageModel
  458.     ENDIF
  459.  
  460. ;
  461. ; pascal OSErr SRContinueRecognition(Recognizer instance)
  462. ;
  463.     IF ┬ GENERATINGCFM THEN
  464.         Macro
  465.         _SRContinueRecognition
  466.             move.w              #$0210,d0
  467.             dc.w                $AA56
  468.         EndM
  469.     ELSE
  470.         IMPORT_CFM_FUNCTION SRContinueRecognition
  471.     ENDIF
  472.  
  473. ;
  474. ; pascal OSErr SRCancelRecognition(Recognizer instance)
  475. ;
  476.     IF ┬ GENERATINGCFM THEN
  477.         Macro
  478.         _SRCancelRecognition
  479.             move.w              #$0211,d0
  480.             dc.w                $AA56
  481.         EndM
  482.     ELSE
  483.         IMPORT_CFM_FUNCTION SRCancelRecognition
  484.     ENDIF
  485.  
  486. ;
  487. ; pascal OSErr SRIdle(void )
  488. ;
  489.     IF ┬ GENERATINGCFM THEN
  490.         Macro
  491.         _SRIdle
  492.             move.w              #$0028,d0
  493.             dc.w                $AA56
  494.         EndM
  495.     ELSE
  496.         IMPORT_CFM_FUNCTION SRIdle
  497.     ENDIF
  498.  
  499. ;  Language Model Building and Manipulation Functions 
  500. ;
  501. ; pascal OSErr SRNewLanguageModel(RecognitionSystem system, LanguageModel *model, const void *name, Size nameLength)
  502. ;
  503.     IF ┬ GENERATINGCFM THEN
  504.         Macro
  505.         _SRNewLanguageModel
  506.             move.w              #$0812,d0
  507.             dc.w                $AA56
  508.         EndM
  509.     ELSE
  510.         IMPORT_CFM_FUNCTION SRNewLanguageModel
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal OSErr SRNewPath(RecognitionSystem system, LMPath *path)
  515. ;
  516.     IF ┬ GENERATINGCFM THEN
  517.         Macro
  518.         _SRNewPath
  519.             move.w              #$0413,d0
  520.             dc.w                $AA56
  521.         EndM
  522.     ELSE
  523.         IMPORT_CFM_FUNCTION SRNewPath
  524.     ENDIF
  525.  
  526. ;
  527. ; pascal OSErr SRNewPhrase(RecognitionSystem system, LMPhrase *phrase, const void *text, Size textLength)
  528. ;
  529.     IF ┬ GENERATINGCFM THEN
  530.         Macro
  531.         _SRNewPhrase
  532.             move.w              #$0814,d0
  533.             dc.w                $AA56
  534.         EndM
  535.     ELSE
  536.         IMPORT_CFM_FUNCTION SRNewPhrase
  537.     ENDIF
  538.  
  539. ;
  540. ; pascal OSErr SRNewWord(RecognitionSystem system, LMWord *word, const void *text, Size textLength)
  541. ;
  542.     IF ┬ GENERATINGCFM THEN
  543.         Macro
  544.         _SRNewWord
  545.             move.w              #$0815,d0
  546.             dc.w                $AA56
  547.         EndM
  548.     ELSE
  549.         IMPORT_CFM_FUNCTION SRNewWord
  550.     ENDIF
  551.  
  552. ;  Operations on any object of the LanguageObject family 
  553. ;
  554. ; pascal OSErr SRPutLanguageObjectIntoHandle(LanguageObject lobj, Handle lobjHandle)
  555. ;
  556.     IF ┬ GENERATINGCFM THEN
  557.         Macro
  558.         _SRPutLanguageObjectIntoHandle
  559.             move.w              #$0416,d0
  560.             dc.w                $AA56
  561.         EndM
  562.     ELSE
  563.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoHandle
  564.     ENDIF
  565.  
  566. ;
  567. ; pascal OSErr SRPutLanguageObjectIntoDataFile(LanguageObject lobj, short fRefNum)
  568. ;
  569.     IF ┬ GENERATINGCFM THEN
  570.         Macro
  571.         _SRPutLanguageObjectIntoDataFile
  572.             move.w              #$0328,d0
  573.             dc.w                $AA56
  574.         EndM
  575.     ELSE
  576.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoDataFile
  577.     ENDIF
  578.  
  579. ;
  580. ; pascal OSErr SRNewLanguageObjectFromHandle(RecognitionSystem system, LanguageObject *lobj, Handle lObjHandle)
  581. ;
  582.     IF ┬ GENERATINGCFM THEN
  583.         Macro
  584.         _SRNewLanguageObjectFromHandle
  585.             move.w              #$0417,d0
  586.             dc.w                $AA56
  587.         EndM
  588.     ELSE
  589.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromHandle
  590.     ENDIF
  591.  
  592. ;
  593. ; pascal OSErr SRNewLanguageObjectFromDataFile(RecognitionSystem system, LanguageObject *lobj, short fRefNum)
  594. ;
  595.     IF ┬ GENERATINGCFM THEN
  596.         Macro
  597.         _SRNewLanguageObjectFromDataFile
  598.             move.w              #$0427,d0
  599.             dc.w                $AA56
  600.         EndM
  601.     ELSE
  602.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromDataFile
  603.     ENDIF
  604.  
  605. ;
  606. ; pascal OSErr SREmptyLanguageObject(LanguageObject lobj)
  607. ;
  608.     IF ┬ GENERATINGCFM THEN
  609.         Macro
  610.         _SREmptyLanguageObject
  611.             move.w              #$0218,d0
  612.             dc.w                $AA56
  613.         EndM
  614.     ELSE
  615.         IMPORT_CFM_FUNCTION SREmptyLanguageObject
  616.     ENDIF
  617.  
  618. ;
  619. ; pascal OSErr SRChangeLanguageObject(LanguageObject lobj, const void *text, Size textLength)
  620. ;
  621.     IF ┬ GENERATINGCFM THEN
  622.         Macro
  623.         _SRChangeLanguageObject
  624.             move.w              #$0619,d0
  625.             dc.w                $AA56
  626.         EndM
  627.     ELSE
  628.         IMPORT_CFM_FUNCTION SRChangeLanguageObject
  629.     ENDIF
  630.  
  631. ;
  632. ; pascal OSErr SRAddLanguageObject(LanguageObject base, LanguageObject addon)
  633. ;
  634.     IF ┬ GENERATINGCFM THEN
  635.         Macro
  636.         _SRAddLanguageObject
  637.             move.w              #$041A,d0
  638.             dc.w                $AA56
  639.         EndM
  640.     ELSE
  641.         IMPORT_CFM_FUNCTION SRAddLanguageObject
  642.     ENDIF
  643.  
  644. ;
  645. ; pascal OSErr SRAddText(LanguageObject base, const void *text, Size textLength, long refCon)
  646. ;
  647.     IF ┬ GENERATINGCFM THEN
  648.         Macro
  649.         _SRAddText
  650.             move.w              #$081B,d0
  651.             dc.w                $AA56
  652.         EndM
  653.     ELSE
  654.         IMPORT_CFM_FUNCTION SRAddText
  655.     ENDIF
  656.  
  657. ;
  658. ; pascal OSErr SRRemoveLanguageObject(LanguageObject base, LanguageObject toRemove)
  659. ;
  660.     IF ┬ GENERATINGCFM THEN
  661.         Macro
  662.         _SRRemoveLanguageObject
  663.             move.w              #$041C,d0
  664.             dc.w                $AA56
  665.         EndM
  666.     ELSE
  667.         IMPORT_CFM_FUNCTION SRRemoveLanguageObject
  668.     ENDIF
  669.  
  670. ;  Utilizing the System Feedback Window 
  671. ;
  672. ; pascal OSErr SRProcessBegin(Recognizer instance, Boolean failed)
  673. ;
  674.     IF ┬ GENERATINGCFM THEN
  675.         Macro
  676.         _SRProcessBegin
  677.             move.w              #$031D,d0
  678.             dc.w                $AA56
  679.         EndM
  680.     ELSE
  681.         IMPORT_CFM_FUNCTION SRProcessBegin
  682.     ENDIF
  683.  
  684. ;
  685. ; pascal OSErr SRProcessEnd(Recognizer instance, Boolean failed)
  686. ;
  687.     IF ┬ GENERATINGCFM THEN
  688.         Macro
  689.         _SRProcessEnd
  690.             move.w              #$031E,d0
  691.             dc.w                $AA56
  692.         EndM
  693.     ELSE
  694.         IMPORT_CFM_FUNCTION SRProcessEnd
  695.     ENDIF
  696.  
  697. ;
  698. ; pascal OSErr SRSpeakAndDrawText(Recognizer instance, const void *text, Size textLength)
  699. ;
  700.     IF ┬ GENERATINGCFM THEN
  701.         Macro
  702.         _SRSpeakAndDrawText
  703.             move.w              #$061F,d0
  704.             dc.w                $AA56
  705.         EndM
  706.     ELSE
  707.         IMPORT_CFM_FUNCTION SRSpeakAndDrawText
  708.     ENDIF
  709.  
  710. ;
  711. ; pascal OSErr SRSpeakText(Recognizer instance, const void *speakText, Size speakLength)
  712. ;
  713.     IF ┬ GENERATINGCFM THEN
  714.         Macro
  715.         _SRSpeakText
  716.             move.w              #$0620,d0
  717.             dc.w                $AA56
  718.         EndM
  719.     ELSE
  720.         IMPORT_CFM_FUNCTION SRSpeakText
  721.     ENDIF
  722.  
  723. ;
  724. ; pascal OSErr SRStopSpeech(Recognizer recognizer)
  725. ;
  726.     IF ┬ GENERATINGCFM THEN
  727.         Macro
  728.         _SRStopSpeech
  729.             move.w              #$0223,d0
  730.             dc.w                $AA56
  731.         EndM
  732.     ELSE
  733.         IMPORT_CFM_FUNCTION SRStopSpeech
  734.     ENDIF
  735.  
  736. ;
  737. ; pascal short SRSpeechBusy(Recognizer recognizer)
  738. ;
  739.     IF ┬ GENERATINGCFM THEN
  740.         Macro
  741.         _SRSpeechBusy
  742.             move.w              #$0224,d0
  743.             dc.w                $AA56
  744.         EndM
  745.     ELSE
  746.         IMPORT_CFM_FUNCTION SRSpeechBusy
  747.     ENDIF
  748.  
  749. ;
  750. ; pascal OSErr SRDrawText(Recognizer instance, const void *dispText, Size dispLength)
  751. ;
  752.     IF ┬ GENERATINGCFM THEN
  753.         Macro
  754.         _SRDrawText
  755.             move.w              #$0621,d0
  756.             dc.w                $AA56
  757.         EndM
  758.     ELSE
  759.         IMPORT_CFM_FUNCTION SRDrawText
  760.     ENDIF
  761.  
  762. ;
  763. ; pascal OSErr SRDrawRecognizedText(Recognizer instance, const void *dispText, Size dispLength)
  764. ;
  765.     IF ┬ GENERATINGCFM THEN
  766.         Macro
  767.         _SRDrawRecognizedText
  768.             move.w              #$0622,d0
  769.             dc.w                $AA56
  770.         EndM
  771.     ELSE
  772.         IMPORT_CFM_FUNCTION SRDrawRecognizedText
  773.     ENDIF
  774.  
  775.     ENDIF ; __SPEECHRECOGNITION__ 
  776.  
  777.